package com.gyt.manager.common.enums;


import lombok.Getter;

/**
 * description.
 *
 * @author gyt create on 2021/5/14 18:01
 */
@Getter
public enum SortTypeEnum {
    DESC(1, "DESC"),
    ASC(2, "ASC");
    private int value;
    private String desc;

    SortTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static SortTypeEnum checkSort(String val){
        for (SortTypeEnum anEnum : values()) {
            if (anEnum.getDesc().equals(val)) {
                return anEnum;
            }
        }
        return null;
    }
}
